<?

unset($step);
$step = '1';
include_once "../conn.php";

$WE_d = strip_tags($WE_d);

if ($submit == 'Save this and add another one')
{

$d1 = array();
$d1[0] = $WSmonth;
$d1[1] = $WSyear;

if (is_array($d1))
	{
		$WE_Start = implode("/" , $d1);
	}

$d2 = array();
$d2[0] = $WEmonth;
$d2[1] = $WEyear;

if (is_array($d2))
	{
		$WE_End = implode("/" , $d2);
	}

$qs1 = "insert into job_work_experience set uname = \"$_SESSION[uname]\", WEn = \"$n\", WE_Start = \"$WE_Start\", WE_End = \"$WE_End\", WE_p = \"$WE_p\", WE_d = \"$WE_d\" ";

$rs1 = mysql_query($qs1) or die(mysql_error());
include_once "accesscontrol.php";
include "1s.php";

}
elseif ( $submit == 'Save this and go to Step 2 (Education)')
{

$d1 = array();
$d1[0] = $WSmonth;
$d1[1] = $WSyear;

if (is_array($d1))
	{
		$WE_Start = implode("/" , $d1);
	}

$d2 = array();
$d2[0] = $WEmonth;
$d2[1] = $WEyear;

if (is_array($d2))
	{
		$WE_End = implode("/" , $d2);
	}

$qs1 = "insert into job_work_experience set uname = \"$_SESSION[uname]\", WEn = \"$n\", WE_Start = \"$WE_Start\", WE_End = \"$WE_End\", WE_p = \"$WE_p\", WE_d = \"$WE_d\" ";

$rs1 = mysql_query($qs1) or die(mysql_error());
	
	header("location:2.php");
	exit();
}
elseif(!empty($rTitle) && !empty($rPar))
{

if(!empty($_FILES[images][name]))
	{
				$NewImageName = $_FILES[images][name];
				copy($_FILES[images][tmp_name], "../re_images/".$NewImageName);
	}
else{
				$NewImageName = 'no.jpg';
}

$dateAdded = date("Y/m/d : H:i:s");

$q1 = "update job_seeker_info set rTitle = \"$rTitle\", rPar = \"$rPar\", employment = \"$emp\", image = \"$NewImageName\", createdTime = \"$dateAdded\" where uname = \"$_SESSION[uname]\" ";
$r1 = mysql_query($q1) or die(mysql_error());
include_once "accesscontrol.php";
include "1s.php";
}



?>


